package top.szymou.modules.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @author: 熟知宇某
 * @date: 2022/4/22 14:19
 * @Blog: https://blog.csdn.net/weixin_43548748
 */
@RestController
public class DemoController {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @GetMapping("getWorld")
    public String getWorld(){
        return "Hello World!!!";
    }

    @GetMapping("getData")
    public List<Map<String, Object>> getData(){
        String sql = "select * from demo_t";
        return jdbcTemplate.queryForList(sql);
    }


}
